package entity;

import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * OnligneId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class OnligneId implements java.io.Serializable {

	// Fields

	private BigDecimal idorder;
	private String numeroSerie;

	// Constructors

	/** default constructor */
	public OnligneId() {
	}

	/** full constructor */
	public OnligneId(BigDecimal idorder, String numeroSerie) {
		this.idorder = idorder;
		this.numeroSerie = numeroSerie;
	}

	// Property accessors

	@Column(name = "idorder", nullable = false, precision = 131089, scale = 0)
	public BigDecimal getIdorder() {
		return this.idorder;
	}

	public void setIdorder(BigDecimal idorder) {
		this.idorder = idorder;
	}

	@Column(name = "numero_serie", nullable = false)
	public String getNumeroSerie() {
		return this.numeroSerie;
	}

	public void setNumeroSerie(String numeroSerie) {
		this.numeroSerie = numeroSerie;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof OnligneId))
			return false;
		OnligneId castOther = (OnligneId) other;

		return ((this.getIdorder() == castOther.getIdorder()) || (this
				.getIdorder() != null && castOther.getIdorder() != null && this
				.getIdorder().equals(castOther.getIdorder())))
				&& ((this.getNumeroSerie() == castOther.getNumeroSerie()) || (this
						.getNumeroSerie() != null
						&& castOther.getNumeroSerie() != null && this
						.getNumeroSerie().equals(castOther.getNumeroSerie())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getIdorder() == null ? 0 : this.getIdorder().hashCode());
		result = 37
				* result
				+ (getNumeroSerie() == null ? 0 : this.getNumeroSerie()
						.hashCode());
		return result;
	}

}